// 用户相关的api
import { get, getResult, post, put } from '@/api/request'
import type { DynaimcPage } from '@/config/data/data'
import type { Result,ResultPopularContent,ResultDynamicDetail } from '@/config/data/result'


/** 社区--热门内容 */
export const reqPopularContent = (query: DynaimcPage):Promise<Result<ResultPopularContent[]>>  => get('/dynamic/page', query);

 
/** 社区--内容詳情 */
export const reqContentDetail = (query: number | string):Promise<Result<ResultDynamicDetail>>  => getResult('/dynamic', query);

/** 社区--点赞或取消点赞 */
export const updateSupport = (query:{id:Number}):Promise<Result<null>> => put("/dynamic/support",query);


/** 社区--动态文章是否已点赞 */
export const isSupport = (id:number):Promise<Result<Boolean>> => getResult("/dynamic/isSupport",id);    